//
//  Step3SubTaskNum.m
//  Gunz
//
//  Created by Joggy on 16/4/16.
//  Copyright © 2016年 NUPT. All rights reserved.
//

#import "Step3SubTaskNum.h"
#import "GZConst.h"

@implementation Step3SubTaskNum

-(instancetype)initWithTitle:(NSString *)title {
    self = [super initWithFrame:CGRectMake(0, 0, [GZConst getScreenWidth], 36)];
    UILabel *titleLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 110*proportion, 17)];
    CGPoint tem = titleLab.layer.position;
    tem.y = self.frame.size.height/2;
    titleLab.layer.position = tem;
    titleLab.textColor = TEXT_TITLE_COLOR;
    titleLab.font = [UIFont systemFontOfSize:14];
    titleLab.textAlignment = NSTextAlignmentRight;
    titleLab.text = title;
    [self addSubview:titleLab];
    _button = [UIButton buttonWithType:UIButtonTypeSystem];
    _button.frame = CGRectMake(0, 0, 48*proportion, 36);
    _button.layer.position = CGPointMake(144*proportion, self.frame.size.height/2);
    [_button setAttributedTitle:[[NSAttributedString alloc] initWithString:@"0" attributes:@{NSForegroundColorAttributeName: TEXT_DETAIL_COLOR, NSFontAttributeName: [UIFont systemFontOfSize:14]}] forState:UIControlStateNormal];
    _button.backgroundColor = [UIColor whiteColor];
    _button.layer.borderWidth = 1;
    _button.layer.borderColor = TEXT_BORDER_COLOR.CGColor;
    _button.layer.cornerRadius = 6;
    [self addSubview:_button];
    UILabel *butLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 20, 17)];
    butLab.layer.position = CGPointMake(_button.frame.origin.x + _button.frame.size.width + 18, self.frame.size.height/2);
    butLab.textColor = TEXT_TITLE_COLOR;
    butLab.font = [UIFont systemFontOfSize:17];
    butLab.text = @"个";
    [self addSubview:butLab];
    return self;
}

@end
